package com.controller;

import com.comment.CommentResult;
import com.domain.entity.Bill;
import com.domain.req.PageReq;
import com.github.pagehelper.PageInfo;
import com.service.BillService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 账单业务相关接口
 */
@CrossOrigin//跨越
@RestController
@Slf4j
@RequestMapping("/bill")
public class BillController {

    @Autowired
    private BillService billService;

    @GetMapping("/pageList")
    public CommentResult<PageInfo<Bill>> pageList(PageReq pageReq) {
        PageInfo<Bill> pageInfo = billService.pageList(pageReq);
        return CommentResult.success(pageInfo);
    }
}
